Skip to content

Namespace generated zephyr headers#84

Merged
kr-t merged 1 commit intomainfrom
features/fix-headers
Oct 16, 2025
Merged

Namespace generated zephyr headers#84
kr-t merged 1 commit intomainfrom
features/fix-headers

Conversation

@kr-t
Copy link
Collaborator

@kr-t kr-t commented Oct 16, 2025

Description

Problem description
Some of the generated headers have pretty generic names, i.e.: version.h, and can potentially conflict with other library / user applications. Ideally, all Zephyr's headers, in-tree or generated, should be namespaced with zephyr/.

Proposed change
To avoid potential conflicts with other library or user application headers due to generic names, introduce a zephyr/ namespace for all Zephyr-generated and in-tree headers. This can be achieved by modifying the CMake files and scripts responsible for generating these headers to include the zephyr/ prefix in their file names and updating the include paths in source files accordingly.

Additionally, ensure that the legacy include paths remains compatible during this transition and update the migration and release notes with details about this change and any necessary mitigation steps for users.

Please check: zephyrproject-rtos/zephyr#73114

Relevant migration notes: https://docs.zephyrproject.org/latest/releases/migration-guide-3.7.html#build-system

Real-time issue:
While trying to build modern zephyr (4.2) with --sysbuild (check this: https://docs.zephyrproject.org/latest/build/sysbuild/index.html) , following error is thrown:

fatal error: autoconf.h: No such file or directory
   10 | #include <autoconf.h>
      |          ^~~~~~~~~~~~
compilation terminated.

because it hasn't been generated yet.

This PR solves this issue and follows earlier migration guide.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Code cleanup/refactoring

How Has This Been Tested?

Building with STM32 U585

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
@kr-t kr-t requested a review from srberard as a code owner October 16, 2025 13:40
@kr-t kr-t self-assigned this Oct 16, 2025
@kr-t kr-t merged commit 889415d into main Oct 16, 2025
11 checks passed
@kr-t kr-t deleted the features/fix-headers branch October 16, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants